package liecai_class.day08;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;

/**
 * BIO - 同步阻塞式IO
 * CONNECT WRITE
 */
public class Demo09 {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket();
        socket.connect(new InetSocketAddress("localhost", 9999));

        OutputStream out = socket.getOutputStream();
        byte [] data = new byte[1024];
        for(int i=0;;i++){
            out.write(data);
            System.out.println(i);
        }
    }
}
